
#第一个
for i in range(1,10):
    for j in range(1,i+1):
        print('{}*{}={:<4}'.format(j, i,  i * j), end='')
    print()
print(1,'='*80)
#第二个
for i in range(9,0,-1):
    for j in range(1,i+1):
        print('{}*{}={:<4}'.format(j, i, i * j), end='')
    print()
print(2,'='*80)
#第三个
for i in range(9,-1,-1):
    for j in range(1,i+1):
        print('{:<8}'.format(''),end='')
    for j in range(9-i,0,-1 ):
        print('{}*{}={:<4}'.format(j,9-i,(9-i)*j), end='')
    print()
print(3,'='*80)
#第四个
for i in range(9,-1,-1):
    for j in range(9-i,0,-1 ):
        print('{:<8}'.format(''), end='')
    #i: 9 8 7
    for j in range(i,0,-1):
        print('{}*{}={:<4}'.format(j, i, j * i), end='')
    print()
print(4,'='*80)
#第五个
i=1
while i<10:
    j=1
    while j<i+1:
        print('{}*{}={:<4}'.format(j, i, i * j), end='')
        j+=1
    i+=1
    print()
print(5,'='*80)
#第六个
i=9
while i>0:
    j=1
    while j<i+1:
        print('{}*{}={:<4}'.format(j, i, i * j), end='')
        j+=1
    i-=1
    print()
print(6,'='*80)
#第七个
i=9
while i>-1:
    j=1
    while j<i+1:
        print('{:<8}'.format(''), end='')
        j+=1
    k=9-i
    while k>0:
        print('{}*{}={:<4}'.format(k, 9 - i, (9 - i) * k), end='')
        k-=1
    i-=1
    print()
print(7,'='*80)
#第八个
i=9
while i>-1:
    j=9-i
    while j>0:
        print('{:<8}'.format(''), end='')
        j-=1
    k=i
    while k>0:
        print('{}*{}={:<4}'.format(k, i, k * i), end='')
        k-=1
    i-=1
    print()
print(8,'='*80)

